package com.softer.wxzj.mapper;

import com.softer.wxzj.entity.AccCalculateInterestDetailLog;
import com.softer.wxzj.entity.AccTransactionLog;
import com.softer.wxzj.mapper.base.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AccCalculateInterestDetailLogMapper extends BaseMapper<AccCalculateInterestDetailLog> {
    /**
     * 根据房间id 和结息日期  查询结息日期之前的最后一笔交易信息
     * @param houseId
     * @param tallyDate
     * @return
     */
    AccTransactionLog getTransLogByHouseIdAndTallyDate(@Param("houseId") String houseId, @Param("tallyDate") String tallyDate);
    /**
     * 根据房屋id查询记账列表
     * @param houseId
     * @return
     */
    List<AccCalculateInterestDetailLog> getLogListByHouseId(String houseId);

    /**
     * 查询大于上次结息日期的交易有效记账列表
     * @param houseId
     * @return
     */
    List<AccCalculateInterestDetailLog> getLogListByHouseIdAndLastDate(@Param("houseId") String houseId,@Param("lastDate") String lastDate);
    /**
     * 根据房屋id和房屋起始日期查询记账列表
     * @param houseId
     * @param lastDate
     * @param currentDate
     * @return
     */
    List<AccCalculateInterestDetailLog> getLogListByHouseIdAndDateInterval(@Param("houseId") String houseId,@Param("lastDate") String lastDate,@Param("currentDate") String currentDate);

    List<AccCalculateInterestDetailLog> getLogOutListByHouseIdAndDateInterval(@Param("houseId") String houseId,@Param("lastDate") String lastDate,@Param("currentDate") String currentDate);
    /**
     * 根据房间id和结息编号查询 房间本次结息的最后记录
     * @param tmpHouseId
     * @param tmpRateNo
     * @return
     */
    AccCalculateInterestDetailLog getLogByHouseIdAndRateNo(@Param("houseId") String tmpHouseId,@Param("rateNo") String tmpRateNo);
    /**
     * 根据结息编号删除结息详情
     * @param rateNo
     * @return
     */
    int deleteByRateNo(String rateNo);
}